package com.bana.fvs.protocol;

import com.bana.sys.protocol.Protocol;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;

/**
 * 设置号角音乐
 */
public class SetHorn extends Protocol{
    @Override
    public short getId()
    {
        return 0xB1;
    }

    public byte[] request(int id,int file,int volume) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(baos);
        dos.writeByte(id);
        dos.writeByte(file);
        dos.writeByte(volume);
        byte[] buffer= baos.toByteArray();
        dos.close();
        baos.close();
        return fillHead(buffer);
    }
}
